﻿using System;

namespace wuliuback
{
    public partial class Favorite : System.Web.UI.Page
    {

        protected void Page_Load(object sender, EventArgs e)
        {
            string userId = Request["user_id"];
            string type = Request["type"];//货源1，车源2，用户3
            string favoriteId=Request["favorite_id"];
            
            string code = "";
            string msg = "";

            String sql = "";
            sql = "insert into t_favorite(user_id,type,favorite_id,time,status) values('" + userId + "','" + type + "','" + favoriteId + "','" + DateTime.Now.ToString() + "',0)";
            
            DbHelper dbHelper = new DbHelper();
            if (dbHelper.Insert(sql))
            {
                code = "0";
                msg = "成功";
            }
            else
            {
                code = "-1";
                msg = "失败";
            }

            Response.Output.WriteLine("{\"code\":\"" + code + "\",\"msg\":\"" + msg + "\"}");
        }

    }
}
